local que_fuyun = fk.CreateSkill {
    name = "que_fuyun",
    anim_type = "defensive",
}
Fk:loadTranslationTable {
    ["que_fuyun"] = "福运",
    [":que_fuyun"] = "准备阶段，你可以展示三张手牌，若这些牌的类型均不同，本回合〖天照〗首次发动时获得每种类型的牌各一张，若不足三种类型，〖天照〗增加一次使用次数。",

    ["@@que_fuyun_ex-turn"] = "畸变 效果",
    [ "@@que_fuyun_up-turn"] = "畸变 次数",

}
que_fuyun:addEffect(fk.EventPhaseStart, {
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(que_fuyun.name) and player.phase == Player.Start and
            player:getHandcardNum() > 2
    end,
    on_cost = function(self, event, target, player, data)
        local room = player.room
        local cards = room:askToCards(player, {
            min_num = 3,
            max_num = 3,
            include_equip = false,
            skill_name = que_fuyun.name,
            pattern = ".",
            prompt = "福运：你可以展示三张牌令〖天照〗改变效果",
            cancelable = true,
        })
        if #cards > 0 then
            event:setCostData(self, { cards = cards })
            return true
        end
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local cards = event:getCostData(self).cards or {}
        player:showCards(cards)
        local types = {}
        for _, id in ipairs(cards) do
            table.insertIfNeed(types, Fk:getCardById(id).type)
        end
        if #types == 3 then
            room:setPlayerMark(player, "@@que_fuyun_ex-turn", 1)
        else
            room:setPlayerMark(player, "@@que_fuyun_up-turn", 1)
        end
    end,
})

return que_fuyun
